/**
 * File    : OpenIDAuthenticationManager.java
 * Created : 2008-10-5
 * By      : LuHuiguo
 */
package com.luhuiguo.sso.service;

import com.luhuiguo.sso.entity.User;
import com.luhuiguo.sso.exception.IdentifierViolationException;
import com.luhuiguo.sso.exception.InvalidRequestException;
import com.luhuiguo.sso.exception.SiteDisallowedException;
import com.luhuiguo.sso.provider.OpenIDAuthRequest;
import com.luhuiguo.sso.provider.OpenIDAuthResponse;

/**
 * @author LuHuiguo
 * @version $Id: OpenIDAuthenticationManager.java 16 2008-10-17 13:13:27Z LuHuiguo $
 * 
 */
public interface OpenIDAuthenticationManager {
	public abstract void validateRequest(User user, OpenIDAuthRequest authReq)
			throws InvalidRequestException, SiteDisallowedException,
			IdentifierViolationException;

	OpenIDAuthResponse autoAllowRequest(User user, OpenIDAuthRequest authReq);

	OpenIDAuthResponse denyRequest(User user, OpenIDAuthRequest authReq);

	OpenIDAuthResponse allowRequest(User user, long personaId,
			OpenIDAuthRequest authReq, boolean alwaysAllow);

	OpenIDAuthResponse checkImmediate(String username, OpenIDAuthRequest authReq);

}
